package com.google.code.shardbatis.mapper;

import com.google.code.shardbatis.bean.UserBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    /**
     * 新增用戶
     *
     * @param user
     * @return
     * @throws Exception
     */
    int insertUser(UserBean user) throws Exception;

    /**
     * 修改用戶
     *
     * @param user
     * @return
     * @throws Exception
     */
    int updateUser(UserBean user) throws Exception;

    /**
     * 刪除用戶
     *
     * @param id
     * @return
     * @throws Exception
     */
    int deleteUser(int id) throws Exception;

    /**
     * 根据id查询用户信息
     *
     * @param id
     * @return
     * @throws Exception
     */
    UserBean selectUserById(long id) throws Exception;

    List<UserBean> selectUserByIdList(@Param("idList") List<Long> idList) throws Exception;

    /**
     * 根据clientSn查询用户信息
     *
     * @param clientSn
     * @return
     * @throws Exception
     */
    UserBean selectUserByClientSn(long clientSn) throws Exception;

    /**
     * 查询所有的用户信息
     *
     * @return
     * @throws Exception
     */
    List<UserBean> selectAllUser() throws Exception;
}
